// Code scaffolded by goctl. Safe to edit.
// goctl 1.9.1

package fileTag

import (
	"audio-server/internal/model"
	"context"

	"audio-server/internal/svc"
	"audio-server/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type FileTagDeleteLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewFileTagDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FileTagDeleteLogic {
	return &FileTagDeleteLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *FileTagDeleteLogic) FileTagDelete(req *types.FileTagDeleteReq) (resp bool, err error) {
	ids := req.Ids
	tagModel := model.NewSysFileTagModel(l.svcCtx.Conn)
	for _, id := range ids {
		err := tagModel.Delete(l.ctx, id)
		if err != nil {
			return false, err
		}

	}

	return true, nil
}
